#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read() {
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 55;
const int inf = 0x3f3f3f3f;

int n,m,Q,h[N],cnt = 1,dis[N],incf[N],pre[N],cost,maxflow,S,T;
bool vis[N];
struct edge { int v,w,c,nxt; } e[(N * N) << 1];
void tlink(int x,int y,int w,int c) { e[++cnt] = (edge) { y,w,c,h[x]}; h[x] = cnt; }
void link(int x,int y,int w,int c) { tlink(x,y,w,c); tlink(y,x,0,-c); }
vector < pii > tf;

bool spfa() {
	queue < int > q; memset(dis,0x3f,sizeof dis); dis[S] = 0; incf[S] = inf; q.push(S); memset(vis,0,sizeof vis); vis[S] = 1;
	while(!q.empty()) {
		int x = q.front(); q.pop();
		for(int i = h[x],y;i;i = e[i].nxt)
			if(dis[y = e[i].v] > dis[x] + e[i].c && e[i].w) {
				dis[y] = dis[x] + e[i].c; incf[y] = min(incf[x],e[i].w); pre[y] = i;
				if(!vis[y]) q.push(y), vis[y] = 1;
			}
		vis[x] = 0;
	}
	return dis[T] < inf;
}

void update() {
	int x = T; cost += dis[T]; maxflow += incf[T]; tf.pb({cost,maxflow});
	while(x ^ S) {
		int i = pre[x]; e[i].w -= incf[T]; e[i ^ 1].w += incf[T]; x = e[i ^ 1].v;
	}
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in; for(int i = 1,u,v,w;i <= m;i++) u = in,v = in,w = in,link(u,v,1,w); S = 1; T = n;
	while(spfa()) update(); Q = in;
	while(Q--) {
		int x = in; db ans = 1e18;
		for(auto d : tf) ans = min(ans,1. * (d.fi + x) / d.se);
		printf("%.8lf\n",ans);
	}
	return 0;
}
